<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = "abcaaaaddebb"

        var o = {};
        for(var i=0;i<str.length;i++){
            if(!0[str[i]]){
                o[str[i]]=1
            }else{
                o[str[i]]++;
            }
        }
        var max = 0;
        var word = "";
        for(var k in o){
            if(o[k]>max){
                max = o[k];
                word = k;
            }
        }
        console.log(word);



        

      
        



    </script>
</body>
</html>